package com.cskaoyan.controller.wx.collect;

import com.cskaoyan.bean.bo.wx.CollectAddOrDeleteBo;
import com.cskaoyan.bean.common.BaseRespVo;
import com.cskaoyan.bean.vo.wx.collect.CollectListVo;
import com.cskaoyan.service.wx.collect.CollectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: bwj
 * @Date: 2022/09/09/22:16
 * @Description:
 */
@RestController
@RequestMapping("wx/collect")
public class WxCollectController {
    @Autowired
    CollectService collectService;

    /**
     * @Author: 宾文杰 @Description: 收藏 @Date: 2022/9/9
     */
    @RequestMapping("list")
    public BaseRespVo<CollectListVo> collectList(Integer type, Integer page, Integer limit) {
        CollectListVo collectListVo = collectService.collectList(type, page, limit);
        return BaseRespVo.ok(collectListVo);
    }

    /**
    * @Author: 宾文杰 @Description: 收藏信息添加与删除 @Date: 2022/9/9
    */
    @RequestMapping("addordelete")
    public BaseRespVo<String> collectAddOrDelete(@RequestBody CollectAddOrDeleteBo addOrDeleteBo) {
        collectService.addOrDelete(addOrDeleteBo);
        return BaseRespVo.ok(null);
    }
}
